//
//  LoginResponse.m
//  suishouxiu
//
//  Created by dinghongyan on 15/6/5.
//  Copyright (c) 2015年 zhongyan. All rights reserved.
//

#import "LoginResponse.h"

@implementation LoginResponse
- (void)setResponseObject:(id)responseObject {
    _responseObject = responseObject;
    if (responseObject) {
        NSString *oid = [responseObject objectForKey:@"user_id"];
        NSString *token = [responseObject objectForKey:@"access_key"];
        NSString *name = [responseObject objectForKey:@"username"];
        [[NSUserDefaults standardUserDefaults] setObject:oid forKey:UserDefault_uid];
        [[NSUserDefaults standardUserDefaults] setObject:token forKey:UserDefault_access_key];
        [[NSUserDefaults standardUserDefaults] setObject:name forKey:UserDefault_uName];
        
        while (![[NSUserDefaults standardUserDefaults] synchronize])
        {
        }
    }
}

@end
